Watch how to download trading robots for free
Find us on Facebook!
Join our fan page
Access the CodeBase from your MetaTrader 5 terminal
Couldn't find the right code? Order it in the Freelance section
How to Write an Expert Advisor or an Indicator

MQL4 Source Code Library for MetaTrader 4

icon

The largest library features codes of free trading Expert Advisors, technical indicators and scripts. With the available applications you can trade in automated mode and analyze price dynamics. Use the library of codes to learn more about financial market sentiments.

Download free applications, test them and run in your MetaTrader 4. You can access them from the MetaTrader 4 platform and the MetaEditor development environment.

Submit your code

Exports closed trades to CSV with Maximum Adverse Excursion (MAE) and Maximum Favorable Excursion (MFE) in points and money, calculated from M1 history, plus the percentage of the available move each trade captured.

Opens charts for all Market Watch symbols or a custom symbol list in one click, on any timeframe, with an optional template applied to each chart. Skips charts that are already open and limits how many are opened at once.

Shades the chart background by volatility regime (Compression, Normal, Expansion) based on the percentile rank of the current ATR. Shows the current regime on the chart, alerts on regime changes and exposes buffers for Expert Advisors.

Shades the chart background by volatility regime (Compression, Normal, Expansion) based on the percentile rank of the current ATR. Shows the current regime on the chart, alerts on regime changes and exposes buffers for Expert Advisors.

Draws Asian, London and New York session range boxes and marks liquidity sweeps: a closed bar that wicks beyond a completed session's high or low and closes back inside. Non-repainting arrows, extended session levels, alerts and iCustom-ready buffers.

Scalping Expert Advisor that reads a 3-period smoothed MA channel (High/Low), places pending stop orders either with the move (Trend) or behind it (Reversal), and trails the stop loss tick by tick. It includes broker-safe order handling for stop level, freeze level, retries and latency.(Inspired by Waygrow Ea)

A two-sided grid EA that lays a small symmetric ladder of pending stop orders around the current price, then escalates in two stages as fills accumulate: first a single opposite-side lot "bump," then a full martingale doubling sequence with two extra grid levels added. The whole basket is watched as one unit and closed the moment its combined floating profit reaches a target, after which a fresh grid re-arms automatically. Built with separate, auto-selected input profiles for XAUUSD and NAS100/US100, since the two symbols need very different lot sizes, grid spacing, and broker minimum-distance handling.

A complete, self-contained trend-reversal Expert Advisor for gold and silver. It waits for an averaged-bar colour flip to mark a possible reversal, then requires price to close back inside a volatility channel before committing to a trade. Stops are placed at real swing structure, position size is derived from your chosen risk, and the trade is closed early whenever the market prints an opposite-direction signal. No external indicators are required — all signal logic is built into the EA. Nothing repaints: every decision is made on closed bars only.

Free multi-timeframe Supertrend indicator for MetaTrader 4 with clear trend lines and Buy/Sell signal arrows.

Visual MT4 indicator that draws the current or selected H1 range and nested M30, M15, M5 and M1 boxes. An EA based on this logic is in development.

Professional open-source trade management utility for MetaTrader 4. Automatically applies Stop Loss, Take Profit, Break Even and Trailing Stop while providing a modern dashboard for efficient position management.

Swing-pivot support and resistance zones clustered by touch count with adaptive zone thickness and higher-timeframe context.

Asian session range breakout indicator for MetaTrader 4. Signals are confirmed on bar close and never repaint. Unlike simple session breakout tools, it also measures the strength of the breakout candle: the candle body must reach a configurable multiple of ATR, so marginal breaks are filtered out. Includes range size filters, an on-chart dashboard with session phase, spread, ATR in pips and a bar close countdown, plus pop-up, sound, email and push alerts.

Professional open-source Margin Calculator for MetaTrader 4. Calculates required margin, Free Margin impact, estimated Margin Level, position value and margin safety.

Professional open-source Risk Calculator for MetaTrader 4. Calculates money risk, account risk percentage, potential profit, Reward-to-Risk ratio, margin requirement and risk level.

Professional open-source Position Size Calculator for MetaTrader 4. Calculates broker-compatible lot size using account value, risk percentage, fixed risk amount and Stop Loss distance with a modern Quantora dashboard.

Professional open-source Trailing Stop manager for MetaTrader 4 with adjustable trailing start, distance, step, minimum profit filter, Magic Number filtering and a modern Quantora dashboard.

Professional open-source Break Even manager for MetaTrader 4. Automatically moves Stop Loss to Break Even using adjustable trigger, offset, Magic Number filtering and a modern Quantora dashboard.

Professional open-source trade management utility for MetaTrader 4. Automatically applies Stop Loss, Take Profit, Break Even and Trailing Stop while providing a modern dashboard for efficient position management.

A DSP oscillator for MT4 that applies Ehlers' Fisher Transform to reshape price into a Gaussian normal distribution, eliminating boundary flattening to catch zero-lag structural reversals.

External Range Liquidity ERL is a custom indicator for MetaTrader 4 designed specifically for traders utilizing Price Action and Smart Money Concepts. This indicator automatically maps the Market Structure and identifies areas where liquidity has been taken, known as a Liquidity Sweep.

BBandsPsar is a custom hybrid indicator that fuses Bollinger Bands’ volatility framework with the Parabolic SAR’s trend-following logic. By integrating these two methodologies, it effectively reconciles market volatility with emerging trend dynamics within a single, cohesive tool.

An institutional market microstructure indicator for MT4 that computes Kyle's Lambda and Amihud Illiquidity ratios to identify institutional order absorption and toxic liquidity vacuums.

This indicator is an implementation of Stochastic of Moving Average. This indicator can be used as a filter indicator. It can be associated with my free indicator "HLPeak_Trend".

Automatically detect Inside Bar patterns, draw projection rectangles, and receive real‑time alerts – all in one powerful indicator. Swing And Full Margin trader

Dynamic Fair Value Gap (FVG) is an MQL5 indicator for MetaTrader 4 that automatically detects market price imbalances. This indicator is perfectly suited for traders utilizing the Smart Money Concepts (SMC) strategy.

this script to make multiple pending order limit or stop order like buystop buylimit or sellstop selllimit

This script will display all account information.

Advanced smoothed Heiken Ashi indicator featuring automated Supply & Demand zones, EMA trend filtering, and multi-indicator momentum confirmation for high-precision trading.

A sleek, color-changing trend follower based on adaptive moving averages with real-time reversal glow signals.

Draws Fibonacci from multiple swing points and finds overlap zones where multiple Fib levels cluster. Confluence zones are dramatically stronger than single levels.

Maps all Draw on Liquidity targets: previous day/week/month highs-lows, equal levels, untested FVGs. Shows WHERE price is heading next.

Detects breaker blocks — order blocks that failed and flipped polarity. Bullish OB broken down becomes bearish breaker (and vice versa).

Exports your complete trade history to a CSV file with comprehensive performance statistics. Ready to import into Excel or Google Sheets for detailed analysis.

Stoch_Cross monitors the %K and %D lines of the Stochastic Oscillator and provides instant confirmation when a bullish or bearish crossover occurs in the zone.

This RSI applied to Kalman filter indicator,This RSI applied to Kalman filter indicator

A professional trade management Expert Advisor for MT4. It replaces static trailing stops with a dynamic, volatility-based ATR Trailing logic, and includes an automated Breakeven feature to protect funded prop firm accounts.

Automatically identifies key psychological "Round Numbers" where institutional liquidity and bank orders are concentrated. Essential for spotting high-probability reversal zones and magnet price targets.

The ultimate institutional benchmark tool for MT4. It accurately plots the Volume Weighted Average Price (VWAP) anchored to daily, weekly, or monthly sessions, including standard deviation bands for high-probability mean-reversion setups.

An essential time-and-price indicator for SMC and ICT traders on MT4. It automatically highlights the Asian Range, London Killzone, and New York Killzone, featuring a built-in Broker GMT Offset adjustment for perfect session timing.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106